package com.credithc.customers.dataservice.mapper.XD;

import com.credithc.baseserv.core.mapper.BsBaseMapper;
import com.credithc.customers.dataservice.po.GdAccountPo;
import com.credithc.customers.dataservice.po.MicroloanUserPO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface MicroloanUserMapper extends BsBaseMapper<MicroloanUserPO> {
    @Select("SELECT Max(id) from microloan_user_auths;")
    Long queryProductMaxId();
    @Select("SELECT  microloan_user_auths.bank_acc_no accountNo,microloan_user_auths.account_type accountType ,microloan_user_auths.bind_state bind_state, microloan_user.sub_system subSystemSign ,microloan_user_auths.create_at accountCreateTime,\n" +
            "microloan_user_auths.update_at accountUpdateTime ,microloan_user.customer_no customerNo, microloan_user.id userSourceId\n" +
            "from  microloan_user_auths\n" +
            "LEFT JOIN microloan_user on microloan_user.id_card = microloan_user_auths.id_no " +
            " where microloan_user_auths.id< #{toString} and microloan_user_auths.id >= #{toString}-1000  ORDER BY microloan_user_auths.id desc;\n")
    List<GdAccountPo> queryDlrProduct(String toString);
}
